package com.jiazhong.mybatis.m1.mapper;

import com.jiazhong.mybatis.m1.bean.Emp;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface EmpMapper {

    List<Emp> findAll();

    Emp findById(Integer id);

    List<Emp> findByName(String name);

    // ❌
    List<Emp> findByEnameAndJob1(String ename, String job);

    // 解决方案
    List<Emp> findByEnameAndJob2(Emp emp);

    List<Emp> findByEnameAndJob3(Map map);

    List<Emp> findByEnameAndJob4(@Param("ename") String ename, @Param("job") String job);

    int save(Emp emp);

    int update(Emp emp);

    int remove(int id);

}
